package com.cloud.poetry.base.feign.fallback;

import com.cloud.poetry.base.feign.QueueFeignClient;
import com.cloud.poetry.base.feign.fallback.impl.QueueFeignClientImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author mengxj
 */
@Component
public class QueueFeignClientFallBack implements FallbackFactory<QueueFeignClient> {

    @Override
    public QueueFeignClient create(Throwable throwable) {
        QueueFeignClientImpl client = new QueueFeignClientImpl();
        client.setThrowable(throwable);
        return client;
    }
}
